<?php

// +----------------------------------------------------------------------
// |国家model
// +----------------------------------------------------------------------
namespace app\admin\Model;

use think\Model;

class CountryModel extends Model{ 
    
    // 表名
    protected $name = 'country';
    // 表主键
    protected $pk = 'id';
   
   // 获取所有有效国家数据
    public function getcountrylist($field='id,description as name')
    {
        $data=$this->field($field)->select()->toArray();
        return array_column($data,null,'id');
    }
    
    // 获取所有有效国家数据
    public function getcountryAllList($field='countryid,description as name')
    {
        $data=$this->field($field)->column($field,'countryid');
        return $data;
    }
}

